package com.example.duanlei417.mypro2.login.lib_login.core;

import android.content.Context;

public class LoginSDK {
    private static LoginSDK instance;
    private Context mApplicationContext;

    private LoginSDK() {
    }

    public static LoginSDK getInstance() {
        if (instance == null) {
            synchronized (LoginSDK.class) {
                if (instance == null) {
                    instance = new LoginSDK();
                }
            }
        }
        return instance;
    }

    public void init(Context context, ILogin iLogin) {
        mApplicationContext = context.getApplicationContext();
        LoginAssistant.getInstance().setApplicationContext(context);
        LoginAssistant.getInstance().setILogin(iLogin);
    }

    /**
     * 单点登录，验证token失效的统一接入入口
     * @param userDefine
     */
    public void serverTokenInvalidation(int userDefine) {
        LoginAssistant.getInstance().serverTokenInvalidation(userDefine);
    }

}
